#ifndef QQ_FRIEND_REQUEST_DELEGATE
#define QQ_FRIEND_REQUEST_DELEGATE

#include <qpainter.h>
#include <qpainterpath.h>
#include <qevent.h>
#include <qstyleditemdelegate.h>

#include <ElaPushButton.h>
#include <ElaTheme.h>

class QQFriendRequestDelegate : public QStyledItemDelegate
{
	Q_OBJECT

public:
	QQFriendRequestDelegate(QObject* parent = nullptr);
	~QQFriendRequestDelegate();
	void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
protected:
	bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override;
signals:
	void add_friend_request_result(const QModelIndex& index, int type);
private:
	int m_common_space{ 10 };
	int  icon_width{ 30 };
	QSize  name_size{ 200,50 };
	QSize button_size{ 60,30 };
};

#endif // !QQ_FRIEND_REQUEST_DELEGATE
